rombios: fix int13h for floppy disk
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 30 Oct 2008 13:27:07 +0000 (13:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 30 Oct 2008 13:27:07 +0000 (13:27 +0000)
A floppy on HVM can't be read correctly.
This fix is taken from upstream bochs-2.3.7.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
tools/firmware/rombios/rombios.c

index 547d5cff87ce4822256d64f8c60339b7f4f82def..0edd37176567fecd3e6c89224fcfa97c670c435d 100644 (file)
@@ -7216,7 +7216,7 @@ BX_INFO("floppy: drive>1 || head>1 ...\n");
         outb(0x03f5, head);
         outb(0x03f5, sector);
         outb(0x03f5, 2); // 512 byte sector size
-        outb(0x03f5, 0); // last sector number possible on track
+        outb(0x03f5, sector + num_sectors - 1); // last sector to read on track
         outb(0x03f5, 0); // Gap length
         outb(0x03f5, 0xff); // Gap length
 
@@ -7364,7 +7364,7 @@ BX_INFO("floppy: drive>1 || head>1 ...\n");
         outb(0x03f5, head);
         outb(0x03f5, sector);
         outb(0x03f5, 2); // 512 byte sector size
-        outb(0x03f5, 0); // last sector number possible on track
+        outb(0x03f5, sector + num_sectors - 1); // last sector to write on track
         outb(0x03f5, 0); // Gap length
         outb(0x03f5, 0xff); // Gap length